Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add acf dump support #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add acf dump support #55

wants to merge 1 commit into from

Conversation

rejedai
Copy link

@rejedai rejedai commented Oct 31, 2023

Added ability to dump to acf format.

vdf.dumps(__test_acf, pretty=True, acf=True)

No modification is required for read, parser reads correctly, test code:

    with open("appmanifest_2348590.acf", "r") as read_acf:
        __manifest_orig = read_acf.read()

        read_acf.seek(0)
        __manifest_dict = vdf.load(read_acf)
        __manifest_dump = vdf.dumps(__manifest_dict, pretty=True, acf=True)
        with open("appmanifest_test.acf", "w") as write_acf:
            vdf.dump(__manifest_dict, write_acf, pretty=True, acf=True)

        print(f"Result: {__manifest_orig == __manifest_dump}")

output:

Result: True

md5sum:

❯ md5sum ./appmanifest_2348590.acf 
ffbafff6611f9be6bd95ff4b30d49f37  ./appmanifest_2348590.acf
❯ md5sum ./appmanifest_test.acf 
ffbafff6611f9be6bd95ff4b30d49f37  ./appmanifest_test.acf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant